﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace OpenAiClient.Models
{
    /// <summary>
    /// 历史记录表
    /// </summary>
    [Table("History")]
    public class HistoryModel
    {
        [Key]
        [Column("Id", TypeName = "varchar(32)")]
        public string? Id { get; set; }

        /// <summary>
        /// 问题
        /// </summary>
        [Required]
        [Column("Question", TypeName = "varchar(256)")]
        public string? Question { get; set; }

        /// <summary>
        /// 答案
        /// </summary>
        [Column("Answer", TypeName = "text")]
        public string? Answer { get; set; }

        /// <summary>
        /// 错误信息
        /// </summary>
        [Column("ErrorMessage", TypeName = "text")]
        public string? ErrorMessage { get; set; }

        /// <summary>
        /// 是否成功：0-失败，1-成功
        /// </summary>
        [Required]
        [Column("IsSuccess", TypeName = "tinyint")]
        public byte IsSuccess { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Required]
        [Column("CreateTime", TypeName = "text")]
        public DateTime CreateTime { get; set; }
    }
}
